Command to get all tables from an oracle database?
Command to get all tables from an oracle database?
27217-Jul-2023
Updated on 18-Jul-2023
Home / DeveloperSection / Forums / Command to get all tables from an oracle database?
Command to get all tables from an oracle database?
Aryan Kumar
18-Jul-2023There are a few different commands that you can use to get all tables from an Oracle database. Here are a few of the most common commands:
SELECT table_name FROM all_tables;
This command will return a list of all tables in the database, including tables that are owned by other users.SELECT table_name FROM user_tables;
This command will return a list of all tables that are owned by the current user.SELECT table_name FROM dba_tables;
This command will return a list of all tables in the database, including tables that are owned by the DBA (database administrator).The
all_tables
,user_tables
, anddba_tables
views are all data dictionary views. Data dictionary views are special views that contain information about the database, such as the names of tables, columns, and users.To run these commands, you will need to connect to the Oracle database using a tool like SQLPlus. Once you are connected, you can run the commands by typing them into the SQLPlus prompt.
For example, to run the
SELECT table_name FROM all_tables;
command, you would type the following into the SQL*Plus prompt:SQL
This would return a list of all tables in the database, including tables that are owned by other users.